home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC]
/
NeXTSTEP 3.3 Dev Intel.iso
/
NextDeveloper
/
Headers
/
indexing
/
IXWeightingDomain.h
< prev
next >
Wrap
Text File
|
1994-04-13
|
2KB
|
61 lines
/*
IXWeightingDomain.h
Copyright 1991, NeXT Computer, Inc.
*/
#import <objc/Object.h>
#import <objc/hashtable.h>
@class IXAttributeParser, IXAttributeTable;
@interface IXWeightingDomain: Object
{
unsigned beenRanked; // true when tokens have been ranked
unsigned totalTokens; // the record of tokens in sample
unsigned uniqueTokens; // record of unique tokens in sample
unsigned indexCount; // record of entries in token index
unsigned totalLength; // the sum of all the token lengths
void *tokenArray; // "lexeme rank count lexeme rank count..."
unsigned *tokenIndex; // array of offsets into token array
}
- initFromDomain:(NXStream *)stream; // reads domain format
- writeDomain:(NXStream *)stream; // write domain format
- initFromHistogram:(NXStream *)stream; // reads histogram format
- writeHistogram:(NXStream *)stream; // writes histogram format
- initFromWFTable:(NXStream *)stream; // reads pre- 3.0 WFTable format
// initializes the weighting domain from an attribute table.
- initFromAttributeTable:(IXAttributeTable *)theTable;
// The following methods initialize the weighting domain from one of the
// attributes in the supplied attribute parser.
- initFromAttributeParser:(IXAttributeParser *)aParser; // for "Default"
- initFromAttributeParser:(IXAttributeParser *)aParser
forAttributeNamed:(const char *)name;
- (unsigned)totalTokens; // how many tokens were seen by parser
- (unsigned)uniqueTokens; // how many unique tokens were found by parser
- (unsigned)countForToken:(void *)token // how many times did token occur
ofLength:(unsigned)aLength;
- (unsigned)rankForToken:(void *)token // rank token against the others
ofLength:(unsigned)aLength;
- (float)frequencyOfToken:(void *)token // ratio token count to total count
ofLength:(unsigned)aLength;
- (float)peculiarityOfToken:(void *)token // frequency relative to domain
ofLength:(unsigned)aLength andFrequency:(float)frequency;
// The following methods provide for iterating over the tokens in the domain.
- (NXHashState)initHashState;
- (BOOL)nextHashState:(NXHashState *)aState
value:(const void **)aValue length:(unsigned *)aLength;
@end